﻿
$(function () {

    // 合作商
    $(".section ul li .rsp").hide();
    $(".section     ul li").hover(function () {
        $(this).find(".rsp").stop().fadeTo(100, 0.7)
        $(this).find(".text").stop().animate({ left: '0' }, { duration: 100 })
    },
    function () {
        $(this).find(".rsp").stop().fadeTo(100, 0)
        $(this).find(".text").stop().animate({ left: '300' }, { duration: "fast" })
        $(this).find(".text").animate({ left: '-300' }, { duration: 0 })
    });

    $(".mr_frUl ul li img").hover(function () {
        $(this).css("border-color", "#A0C0EB");
    },
    function () {
        (this).css("border-color", "#d8d8d8");
    });
    $(".mr_frbox").slide({ titCell: "", mainCell: ".mr_frUl ul", autoPage: true, effect: "leftLoop", autoPlay: true, vis: 6 });

    $.ajax({
        type: "Get",
        url: "ProductList",
        data: null,
        success: function (response) {
            var productList = response.ProductList;

            var html = [];
            html.push("<div><ul class='cf' style='margin:0px;'>");
            for (var i = 0; i < productList.length; i++) {
                var product = productList[i];
                if (i == 8) {
                    html.push("<div id='otherpuduct' style='display:none'>");
                }
                html.push("<li><a><div class='normal'><img src='/Public/Images/Product/" + product.ImageUrl + "' alt='' title=''><h3>" + product.Title + "</h3><p><span>" + product.ShortDesc + "</span></p></div>");
                html.push("<div class='staff'><div class='cf'><div class='js_content fl'><h4>" + product.Title + "</h4><p>" + product.TitleEn + "</p></div>");
                html.push("<div style='clear:both;'></div></div><p class='txt'>" + product.Desc + "</p></div></a></li>");
                if (i > 7 && i == (productList.leng - 1)) {
                    html.push("</div>");
                }
            }
            html.push("</ul></div>");

            if (productList.length > 7) {

            }
            $("#productList").html(html.join(""));

            // 展开全部
            if ($("#showFunction")) {
                $("#showFunction").click(function () {

                    var ss = $(".new-courses .scroll_courses_wrap");
                    $("#otherpuduct").toggle(1000);
                });
            }
        },
        dataType: "json"
    });



});
